package com.fwj.authorization.staff.controller;

import com.fwj.authorization.staff.entity.SysTenant;
import com.fwj.authorization.staff.service.SysTenantService;
import com.fwj.base.entity.R;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModelProperty;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 租户控制器
 *
 * @author 樊温军
 * @date 2025/3/18 上午10:32
 */
@Slf4j
@RestController
@RequestMapping("/tenant")
@Api(tags = "租户控制器")
@RequiredArgsConstructor
public class SysTenantController {

    private final SysTenantService sysTenantService;

    /**
     * 获取所有正常状态的租户
     *
     * @return List<SysTenant>
     */
    @ApiModelProperty(value = "获取所有正常状态的租户")
    @GetMapping("/normal/list")
    public R<List<SysTenant>> getNormalTenant() {
        return R.ok(sysTenantService.getNormalTenant(), "获取成功");
    }

}

